﻿@inject IStringLocalizer<Foo> LocalizerFoo

<Table TItem="Foo"
        Items="@Items.Take(10)"
        IsBordered="true"
        IsStriped="true"
        IsMultipleSelect="true"
        IsFixedHeader="true"
        FixedExtendButtonsColumn="true"
        Height="200"
        FixedMultipleColumn="true"
        ShowExtendButtons="true"
        RenderMode="TableRenderMode.Table" class="table-fix-column-demo">
    <TableColumns>
        <TableColumn @bind-Field="@context.Name" Width="100" />
        <TableColumn @bind-Field="@context.DateTime" Width="180" />
        <TableColumn @bind-Field="@context.Address" Width="900" />
        <TableColumn @bind-Field="@context.Education" Width="100" />
        <TableColumn @bind-Field="@context.Count" Width="100" />
        <TableColumn @bind-Field="@context.Complete" Width="100" />
    </TableColumns>
</Table>

<Table TItem="Foo"
        Items="@Items.Take(10)"
        IsBordered="true"
        IsStriped="true"
        IsMultipleSelect="true"
        IsFixedHeader="true"
        FixedExtendButtonsColumn="true"
        IsExtendButtonsInRowHeader="true"
        FixedMultipleColumn="true"
        ShowExtendButtons="true"
        RenderMode="TableRenderMode.Table"
        Height="200"
        class="table-fix-column-demo mt-3">
    <TableColumns>
        <TableColumn @bind-Field="@context.Name" Width="100" />
        <TableColumn @bind-Field="@context.DateTime" Width="180" />
        <TableColumn @bind-Field="@context.Address" Width="900" />
        <TableColumn @bind-Field="@context.Education" Width="100" />
        <TableColumn @bind-Field="@context.Count" Width="100" />
        <TableColumn @bind-Field="@context.Complete" Width="100" />
    </TableColumns>
</Table>

@code {
    /// <summary>
    /// Foo 类为Demo测试用，如有需要请自行下载源码查阅
    /// Foo class is used for Demo test, please download the source code if necessary
    /// https://gitee.com/LongbowEnterprise/BootstrapBlazor/blob/main/src/BootstrapBlazor.Shared/Data/Foo.cs
    /// </summary>
    [NotNull]
    private List<Foo>? Items { get; set; }

    /// <summary>
    /// OnInitialized method
    /// </summary>
    protected override void OnInitialized()
    {
        base.OnInitialized();

        Items = Foo.GenerateFoo(LocalizerFoo);
    }
}
